import config from "@/config"
import http from "@/utils/request"

export default {
	//客户
	client:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/lists`,
			name: "获取客户列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/all`,
			name: "获取客户列表 -- 全部",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/edit`,
			name: "修改客户",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/add`,
			name: "添加客户",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/delete`,
			name: "删除客户",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        detail: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/detail`,
			name: "客户详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		update_status: {
			url: `${config.API_URL}/adminapi/shop.ShopCustomer/updateStatus`,
			name: "修改客户状态",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
    // 客户来源
    source:{
        list: {
			url: `${config.API_URL}/adminapi/shop.CustomerSource/lists`,
			name: "获取客户来源列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.CustomerSource/all`,
			name: "获取客户来源列表 -- 全部",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.CustomerSource/edit`,
			name: "修改客户来源",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.CustomerSource/add`,
			name: "添加客户来源",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.CustomerSource/delete`,
			name: "删除客户来源",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
    },
}
